package cn.cloud9.intf;

import cn.cloud9.po.User;

import javax.jws.WebService;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.util.List;

@WebService
public interface UserService {

    @POST
    @Path("/save")
    boolean saveUser(User user);

    @DELETE
    @Path("delete/{id}")
    boolean deleteUser(@PathParam("id") Integer code);

    @PUT()
    @Path("/update")
    boolean updateUser(User user);

    @GET
    @Path("/list")
    @Produces({MediaType.APPLICATION_JSON})
    List<User> listUsers();

    @GET
    @Path("/find/{id}")
    @Produces(MediaType.APPLICATION_JSON)
    User findUserById(@PathParam("id") Integer code);
}
